<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function add_whiteboard_xmpp_account($user_id, $login, $domain) {
    if(!$user_id || strlen($login) <= 0 || strlen($domain) <= 0) {
        return FALSE;
    }
    $timestamp = time();
    $query = "INSERT INTO whiteboard_xmpp_accounts(user_id, login, domain, timestamp) VALUES('$user_id', '$login', '$domain', '$timestamp')";
    //echo $query;
    return safe_insert_query($query);
    
}

function get_whiteboard_xmpp_accounts($user_id) {
    $query = "SELECT id, user_id, login, domain, timestamp FROM whiteboard_xmpp_accounts WHERE user_id = '$user_id'";
    return safe_select_query($query);
}
?>
